package com.csea.common.domain.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.csea.common.domain.dos.UserAccountDo;
import org.apache.ibatis.annotations.Mapper;

/**
 * 用户账户数据访问对象接口，继承 BaseMapper 可使用 MyBatis-Plus 提供的基础数据库操作方法
 */
@Mapper
public interface UserAccountMapper extends BaseMapper<UserAccountDo> {

    default UserAccountDo selectByUsername(String username) {
        return selectOne(Wrappers.<UserAccountDo>lambdaQuery()
                .eq(UserAccountDo::getUsername, username));
    }
}